home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / keyb / fix101ky.zip / FIX101KY.DOC < prev    next >
Text File  |  1988-07-24  |  4KB  |  87 lines

  1.                    Copyright (c) 1988  Thomas G. Hanlin III
  2.  
  3.  
  4.                                 FIX101KY v1.0
  5.                    "Enhanced" keyboard redefinition utility
  6.  
  7.  
  8.  
  9.  
  10.      The purpose of this tiny TSR is to make the 101-key "enhanced" keyboard
  11. more like earlier IBM keyboards (or indeed, like any other keyboard).  It
  12. turns off the "num lock" state when executed, and thereafter redefines the
  13. meaning of a number of keys.
  14.  
  15.  
  16. DISTRIBUTION:
  17.  
  18.      This utility may be distributed freely, PROVIDED that it is distributed
  19. with all of its files, and with those files in unmodified condition.  The
  20. files that should be here are FIX101KY.ASM, FIX101KY.COM, FIX101KY.DOC, and
  21. SNOOP.ASM.  No fee may be charged for distribution, other than a shipping and
  22. handling fee which may not exceed $6.00.
  23.  
  24.  
  25. GENERAL NOTES:
  26.  
  27.      FIX101KY.COM is a terminate-and-stay-resident (TSR) program.  It
  28. occupies less than 400 bytes of memory.  No provision has been made to detect
  29. previous loads of the program, since it is intended to be executed only once,
  30. when you start up your computer.  It is suggested that if you find the
  31. program useful, you should put it in your AUTOEXEC.BAT file.  See your DOS
  32. manual if you have any questions about AUTOEXEC files.
  33.  
  34.      When the TSR is first installed, it will turn off the "Num Lock" state,
  35. so that you won't be obliged to use the new, badly-designed cursor pad.  This
  36. is done before the TSR is activated, and is not a permanent state.
  37.  
  38.      After installation, FIX101KY remaps a number of keys to more expected
  39. positions.  This redefinition will be semi-permanent, in that it will last
  40. until you reboot or turn off your computer.  Some programs that access the
  41. keyboard directly, bypassing usual methods, may not be affected by the
  42. redefinition.  The new keyboard will act as follows:
  43.  
  44.      Used To Be       Will Be
  45.      ==========       =======
  46.      ~ `              ESC
  47.      ESC              ~ `
  48.      CAPS LOCK        CTRL
  49.      CTRL             ALT
  50.      ALT              CAPS LOCK
  51.  
  52.  
  53. PROGRAMMING NOTES:
  54.  
  55.      Source code, in assembly language, has been provided.  This will enable
  56. you to redefine the keyboard to suit your own tastes, assuming you are fairly
  57. conversant with assembly language.  Please do not distribute modified
  58. versions of FIX101KY.  Any changes you make should be for your own use only.
  59.  
  60.      The FIX101KY utility hooks into INT 15h, which used to be for cassette
  61. handling, and is now "miscellaneous system services".  Among those services
  62. is keyboard handling.  We're modifying the keypress information before it
  63. gets seen by other programs.  Since it's raw information, we have to account
  64. for each key in two states:
  65.    1) The key is first pressed.  We get a scan code below 80h.
  66.    2) The key is released.  We get a scan code ORed with 80h.
  67.  
  68.      Since the keyboard handler is invoked fairly often, it's important to
  69. keep the code as fast as reasonably possible.  Since it's a TSR and takes up
  70. valuable system memory, it's also important to keep the code as small as
  71. reasonably possible, although speed largely takes precedence.  FIX101KY was
  72. designed with that in mind, so if the code doesn't appear as elegant as it
  73. might be, please remember these constraints.  Also note that no registers
  74. are modified, to avoid the overhead of saving and restoring.  With an
  75. interrupt handler, you've got to leave things as you found them... and you
  76. can't count on an existing stack, since anything could have been happening
  77. when the interrupt took place.
  78.  
  79.      The SNOOP.ASM file contains a quick-and-dirty utility which will let you
  80. snoop on the scan codes that are returned by various keys.  It writes the
  81. information directly into video memory, in the upper left corner of the
  82. screen.  It assumes you're in text mode, and presents the scan code as a
  83. displayed character.  You can decode this using an extended-ASCII chart.
  84. Don't forget to account for the 80h key release flag.  Note also that you may
  85. have to modify the video segment address for your monitor: B000h (MDA) is
  86. assumed, whereas you may want to use B800h (CGA).
  87.